<template>
  <div class="page_set">
    <!-- 法币设置 -->
    <div class="content_leset">
      <div class="leset_head">
        <section class="g-full-header">
          <div class="g-full-in flex-between-center overflow-hide">
            <div class="flex-y-center mobile-header">
              <div class="top_link">
                <div class="top_zero">
                  <el-breadcrumb separator-class="el-icon-arrow-right">
                    <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                    <el-breadcrumb-item :to="{ path: '/mycenter/security' }">个人中心</el-breadcrumb-item>
                    <el-breadcrumb-item>糖果社区</el-breadcrumb-item>
                  </el-breadcrumb>
                </div>
              </div>
            </div>
            <p class="spilte-in"></p>
            <div class="apply_btn">
              <el-button type="primary" @click="navigateTo('/mycenter/candyCoexch')">兑换</el-button>
            </div>
          </div>
        </section>
      </div>
      <!-- cont -->
      <div class="container myinvite qiandao">
        <div class="qiandao_btn m-top-15">
          <div class="apply_btn flex-between">
              <div class="flex">
                <p>签到累计 <em class="color_down">{{siginAllDay}} 天</em> </p>
                <p class="m-left-15">签到累计奖励总额：<em class="color_down"> {{siginAll}}</em> </p>
              </div>
              
              <el-button type="primary" @click="siginBtn()" icon="el-icon-map-location" :disabled="btnDIs">点击签到</el-button>
          </div>
        </div>
        <div class="qiandao_total m-top-15">
          <template>
            <el-table
              :data="tableData"
              style="width: 100%">
              <el-table-column
                prop="wdate"
                label="日期"
                width="280">
              </el-table-column>
              <el-table-column
                prop="number"
                label="数量"
                width="280">
              </el-table-column>
              <el-table-column
                prop="coin"
                label="币种">
              </el-table-column>
            </el-table>
          </template>
        </div>
      </div>
    </div>
    <!-- 弹窗 -->
  </div>
</template>
<script>
import axios from "axios";

export default {
  components: {
    
  },
  data() {
    return {
      tableData:[],
      siginAll:"0",
      siginAllDay:"0",
      btnDIs:false,
    };
  },
  mounted() {
    this.signin_order();
    this.signin_volume();
    this.signin_day();
  },
  methods: {
    siginBtn(){
      this.request(this.api.add_signin).then(res => {
        if (res.code == "0") {
          this.$message({
            message: '恭喜你，签到成功！请勿重复签到',
            type: 'success'
          });
        }else{
          this.$message(res.msg);
          this.btnDIs=true;
        }
      })
    },
    signin_order() {
      this.request(this.api.signin_order,{page:'1',limit:'30'}).then(res => {
        if (res.code == "0") {
          this.tableData = res.data;
        }
      })
    },
    signin_volume(){
      this.request(this.api.signin_volume,).then(res => {
        if (res.code == "0") {
          this.siginAll = res.data[0].volume;
        }
      })
    },
    signin_day(){
      this.request(this.api.signin_day,).then(res => {
        if (res.code == "0") {
          this.siginAllDay = res.data[0].volume;
        }
      })
    },
  }
};
</script>

<style lang="scss" scoped>
.content_leset {
  .container {
    margin: 0 auto;
    width: 1200px;
  }
  .myinvite{
    min-height: 800px;
  }
  .g-full-header {
    width: 100%;
    background-color: #1b2945;
    padding: 46px 0;
    border-top: 1px solid #171c2c;
  }
  .g-full-in {
    width: 1200px;
    margin: 0 auto;
    .mobile-name {
      display: none;
    }
  }
}

//
.flex-between,
.flex-between-center {
  display: flex;
  justify-content: space-between;
  align-items:center ;
}
.flex-between-center,
.flex-start-center {
  align-items: center;
}
.flex-center,
.flex-y-center {
  display: flex;
  align-items: center;
}
.flex-auto {
    flex: 1 1 auto;
}
.font24 {
  font-size: 24px;
}
.g-full-in .line:after {
  content: " / ";
  display: inline-block;
  margin: 0 32px;
}
.font12 {
  font-size: 12px;
}
.cursor {
  cursor: pointer;
}
.g-full-in {
  .buy {
    color: #0da88b;
  }
  .sell {
    color: #ef5656;
  }
  .indent {
    margin-bottom: 8px;
  }
}
.font-gray {
    color: #9aa5b5;
}
.font-black {
    color: #495666;
}

// 糖果社区
.top_link{
  .top_zero{
    .el-breadcrumb{
      span.is-link{
        color: #357ce1!important;
      }
      
    }
  }
}
.qiandao{
  .qiandao_total{

  }
}
</style>
